?
SolvedPrivate

SOAP Request Apachea Axis2 Client Requests to an external Server

Posted on 2013-05-17
3
Medium Priority
?
89 Views
Last Modified: 2016-02-10
Hello,
i am using apache axis2  to create my SOAP request to the server from client

i have successfully recieved a working response message from the external soap service;
i have created 2 different Apache Axis2 Soap Java code files that creates then same request XML syntax
one of them is working. the other request response shows me a error message from the server


the thing is : both request syntaxes are the same

only the way i create them in apache axis2 is different:


My XML SOAP Request:
<?xml version='1.0' encoding='utf-8'?>
<soap:Envelope  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<CheckLogin xmlns="http://tempuri.org/">
<loginHeader
    xmlns:i="http://www.w3.org/2001/XMLSchema-instance"          
    xmlns:a="http://schemas.datacontract.org/2004/07/WcfService">
      <a:AgentId>*********</a:AgentId>
      <a:Username>*******</a:Username>
      <a:Password>********</a:Password>
      <a:Language>en</a:Language>
</loginHeader></CheckLogin></soap:Body></soap:Envelope>

during the creation of this syntax  :
if i use " loginHeader.declareNamespace()" to add those :i and :a to the syntax and  
create the child nodes with OMElement   _AgentId      = fac.createOMElement("AgentId", OMNamespace);

my request doesnt work on the server the server responses a error message the function needs language parameter . and so on...


but if i add these  i: and a:   with   the code syntax of " loginHeader.addAttribute("xmlns:a", "http://schemas.datacontract.org/2004/07/WcfService", null);

and also create the child nodes as with the code syntax of
OMElement   _AgentId      = fac.createOMElement("a:AgentId", null);

than it works on the server



why is this difference could any one can tell me ? to make me understand?
0
Comment
Question by:R_A_Y
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 36

Expert Comment

by:mccarl
ID: 39177117
the thing is : both request syntaxes are the same
That can't be true since the server wouldn't give you different results then. Can you post the exact actual output request generated by each method? You can mask out sensitive details but please keep all the structural element stuff intact!
0
 

Author Comment

by:R_A_Y
ID: 39180213
(SoapContex-02.java)
<?xml version='1.0' encoding='utf-8'?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><CountryList xmlns="http://tempuri.org/"><loginHeader xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:a="http://schemas.datacontract.org/2004/07/WcfService"><a:AgentId>***********</a:AgentId><a:Username>***********</a:Username><a:Password>********</a:Password><a:Language>en</a:Language></loginHeader></CountryList></soap:Body></soap:Envelope>

Returns this : Could not find stored procedure 'COUNTRY_LIST_WITH_CONTINENT_SUB_0_ML'.
when i ask the this message to the company they are saying that :" it seem to not getting the language parameter they said to get this message"

the second request is the working one :
(SoapContex.java)
<?xml version='1.0' encoding='utf-8'?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><CountryList xmlns="http://tempuri.org/"><loginHeader xmlns:a="http://schemas.datacontract.org/2004/07/WcfService" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><a:AgentId>**********************</a:AgentId><a:Language>en</a:Language><a:Password>****************</a:Password><a:Username>**************</a:Username></loginHeader></CountryList></soap:Body></soap:Envelope>


they are the same request ?
i also attached the creation code scripts of these requests
SoapContex.java
SoapContext-02.java
0
 
LVL 35

Accepted Solution

by:
girionis earned 2000 total points
ID: 39180586
They are not the same requests. The <a:Language>en</a:Language> appears as the last element in one, while it appears as the second element in the other.

You also pass different information in the two requests, so content-wise they are not the same. It is possible that the user who tries to log in does not have the rights to run the COUNTRY_LIST_WITH_CONTINENT_SUB_0_ML stored procedure.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
New Relic recently released its Synthetics product that allows for the creation of performance monitors that periodically test a site's performance. If you wish to test an interactive workflow New Relic employs Selenium WebDriverJS to run those test…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses
Course of the Month8 days, 10 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question