SolvedPrivate

SOAP Request Apachea Axis2 Client Requests to an external Server

Posted on 2013-05-17
3
76 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
3 Comments
 
LVL 35

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 500 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
login jsp example 24 65
SequenceInputStream example 3 19
java imports not found 4 25
Selenium docs api java index 3 48
While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
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…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to implement Singleton Design Pattern in Java.

840 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