ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Default Namespace Problem with SOAP Request Msg

Post new topic  Reply to topic
 Default Namespace Problem with SOAP Request Msg « View previous topic :: View next topic » 
Author Message
SandiSan
PostPosted: Tue Sep 26, 2006 5:56 pm    Post subject: Default Namespace Problem with SOAP Request Msg Reply with quote

Acolyte

Joined: 01 Apr 2006
Posts: 57
Location: Pune/India

Hi

We are trying to call a webservice after creating soap message that have default namespace.We are using XMLNS are message domain.

What happening is even if we set the namespace to default the parser is adding prefix to default namespace as xmlns:NS1.So our webservice call fails.

Java Code For Creating Soap Msg
---------------------------------------
mbElementOutBodyParser.createElementAsLastChild(MbXMLNS.XML_DECL,
"version", "1.0");
MbElement mbElementEnvelope = mbElementOutBodyParser
.createElementAsLastChild(MbXMLNS.ELEMENT, "Envelope", null);

mbElementEnvelope
.setNamespace("http://schemas.xmlsoap.org/soap/envelope/");
mbElementEnvelope.createElementAsLastChild(MbXMLNS.NAMESPACE_DECL,
"SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/")
.setNamespace("xmlns");
mbElementEnvelope.createElementAsLastChild(MbXMLNS.NAMESPACE_DECL,
"q0", "http://www.ffic.com/Agency/AgencyLocationService/")
.setNamespace("xmlns");
mbElementEnvelope.createElementAsLastChild(MbXMLNS.NAMESPACE_DECL,
"xsd", "http://www.w3.org/2001/XMLSchema").setNamespace(
"xmlns");
mbElementEnvelope.createElementAsLastChild(MbXMLNS.NAMESPACE_DECL,
"xsi", "http://www.w3.org/2001/XMLSchema-instance")
.setNamespace("xmlns");

MbElement mbElementInBody = inMessage.getRootElement()
.getLastChild();

MbXPath mbXPathCreateMSG = new MbXPath(
//"/SOAP-ENV:Envelope/?SOAP-ENV:Body/?q0:GetLocationInfo/?ACORD/?InsuranceSvcRq/?$RqUID[set-value($rqId)]/?>AgencyLocationInfoRq/?LocationCode[set-value($sLocCodeVal)]");
"/SOAP-ENV:Envelope/?SOAP-ENV:Body/?q0:GetLocationInfo/?ACORD");

// mbXPathCreateMSG.assignVariable("rqId", sReUID);
// mbXPathCreateMSG.assignVariable("sLocCodeVal", sLocCodeVal);

mbXPathCreateMSG.addNamespacePrefix("SOAP-ENV",
"http://schemas.xmlsoap.org/soap/envelope/");
mbXPathCreateMSG.addNamespacePrefix("q0",
"http://www.ffic.com/Agency/AgencyLocationService/");

// Evaluate our expression against mbElementOutBodyParser which will
// build our XML instance

mbElementOutBodyParser.evaluateXPath(mbXPathCreateMSG);

MbElement mbElementCursorACORD = mbElementOutRoot
.getFirstElementByPath("/XMLNS/Envelope/Body/GetLocationInfo/ACORD");
mbElementCursorACORD.createElementAsLastChild(
MbXMLNS.NAMESPACE_DECL).setNamespace(
"http://www.ACORD.org/standards/PC_Surety/ACORD1.8.0/xml/");
mbElementCursorACORD.createElementAsLastChild(
MbXMLNS.NAMESPACE_DECL, "xsd",
"http://www.w3.org/2001/XMLSchema").setNamespace("xmlns");
mbElementCursorACORD.createElementAsLastChild(
MbXMLNS.NAMESPACE_DECL, "xsi",
"http://www.w3.org/2001/XMLSchema-instance").setNamespace(
"xmlns");
Soap request message that we want to send
---------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:q0="http://www.ffic.com/Agency/AgencyLocationService/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<q0:GetLocationInfo>
<ACORD xmlns="http://www.ACORD.org/standards/PC_Surety/ACORD1.8.0/xml/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InsuranceSvcRq>
<RqUID>e3ccbe2e-7de8-4a69-b251-db49a42346cc</RqUID>
<AgencyLocationInfoRq>
<LocationCode>343434</LocationCode>
</AgencyLocationInfoRq>
</InsuranceSvcRq>
</ACORD>
</q0:GetLocationInfo>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


Above Java Code is appending prefix as xmlns:NS1="http://www.ACORD.org/standards/PC_Surety/ACORD1.8.0/xml/" we want to get rid of this.

Please let us know were we are going wrong

Regards
SandiSan
Back to top
View user's profile Send private message Yahoo Messenger
kimbert
PostPosted: Wed Sep 27, 2006 12:37 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Hi SandiSan,
We should be able to solve this fairly easily. In XMLNS, the contents of the message tree are the only input to the XML serializer. Please put a trace node immediately before the output node and trace ${Root}. Post the output of the trace node here.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Default Namespace Problem with SOAP Request Msg
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.