SolvedPrivate

SOAP Request Apachea Axis2 Client Requests to an external Server

Posted on 2013-05-17
3
75 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
For some reason Google Apps has decided to reserve 'www' for your new domain which results in an error when trying to map the web address 'www' to a certain site in your Google Sites. The error is 'this address is already being used' and after some …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

809 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