SolvedPrivate

SOAP Request Apachea Axis2 Client Requests to an external Server

Posted on 2013-05-17
3
72 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
Comment Utility
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
Comment Utility
(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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

The task of choosing a web design company to build a website for your business should never be taken in a light manner. Provided the fact that your website will act as a representative to your business and will be responsible for imposing an online …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now