Author Message
gfava
Joined: Sep 28, 2017
Messages: 16
Offline
Hi Guys,
still here for asking an help with WS.
I’m facing a problem.
Importing a WS wsdl in the Dialog Designer 5.1 for some strange unknown reason, one of the metod I'm interested on ("getPHeaderOutput()") is not showed as expected on the instantiated objects.
The same behaviour is not present whether I import the same wsdl in the Ecplise “Version: Neon.3 Release (4.6.3)”.

What I'm seeing is that in DD environment the wsdl is arranged with a father class "stub" and all the rest; in the Eclipse Neon instead the structure is completely different. (see the attached screenshoot) and there is no stub...

Is there something I can do to fix the issue?

Many thanks

Filename ServiceCRM.wsdl [Disk] Download
  • [Thumb - dd.png]
[Disk] Download
  • [Thumb - neon.png]
[Disk] Download
gfava
Joined: Sep 28, 2017
Messages: 16
Offline
I would add a thing.
DD (eclipse neon was different) allows the import of one operation at a time and I chosed only the one I was interested in. Do you think this could be a problem?

Thanks
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
It is not clear what you are doing here. Speciffically in Neon. DD 5.1 is not supported in Neon, nor is the 5.1 release supported.
In DD 5.1 you are not specifying if you are using Axis 1.4 or Axis 2 there or in Neon. So there is nothing I can add at this point.
gfava
Joined: Sep 28, 2017
Messages: 16
Offline
Hi Ross,
I mentioned Ecplise Neon only for highlight that in an external environment I see the correct behaviour.

Regarding DD 5.1, you're right and I got that is DD 5.1 is not supported anymore, but unlikely I have to finalize some changes in an existing application with this release.
If you have any hint they are really appreciated. Anyhow I used Axis 2.

RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
The Axis in Neon is likely using 1.6.2 or greater. OD 5.1 uses Axis 1.5. I suspect that is the difference.
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
getpheaderoutput is not even defined in the WSDL. This is some artifact that a newer Axis generates. Note also that getPHeaderOutput is a private method and not accessible.

I also wold not say that one version of the code generation is more correct that the other, they are just different. You should really try and describe what you are trying to accomplish.
gfava
Joined: Sep 28, 2017
Messages: 16
Offline
Actually such a metod is used and appears on a wrong object (in DD 5.1).
I was suspecting that the issue is due because I can choose only one "operation" at a time during the wsdl import?

but... not so sure.

It's quite complicated to explain too..

Thanks the same for your collaboration, I'll continue to investigate with the WS owners

Bye
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
If you are interested in headers then use the headers section to extrace/set them.
gfava
Joined: Sep 28, 2017
Messages: 16
Offline
Hi all,
just to summarize, my issue was that from the imported wsdl I had neither metods nor operations to read the SOAP header tags.
I used Axis2.
Following the piece of code, working perfectly.

It could be a good example to quickly retrieve whatever you need fom the WS answers headers:


//This is th Stub initializzation
RamCRMWebStub stub = null;
try {
stub = new RamCRMWebStub();
} catch (AxisFault e) {}
..
..

//"infoSolutionsCRM" is the WS Opeation to request information (obviously in my case)
res = stub.infoSolutionsCRM(reqBody, reqHeader);

//This is the code to ged the header tags and its own values

ServiceClient client; Options option;
client = stub._getServiceClient();
option = client.getOptions();
OperationContext oprCtxt = stub._getServiceClient().getLastOperationContext();
MessageContext inMsgContext;
inMsgContext = oprCtxt.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
Iterator headers2 = inMsgContext.getEnvelope().getHeader().getHeadersToProcess(null);
while (headers2.hasNext()) {
SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock) headers2.next();
String localName = soapHeaderBlock.getLocalName();
Iterator tags = soapHeaderBlock.getChildElements();
while (tags.hasNext()){
OMElement tagContent = (OMElement)tags.next();
String tagName = tagContent.getLocalName();
if (tagName == "PErrorMessageOutput"){
Iterator errors = tagContent.getChildren();
while (errors.hasNext()){
OMElement errorsElement = (OMElement) errors.next();
String testApp = errorsElement.getLocalName();
String app = errorsElement.getText();
if (testApp == "MessageCode"){
messageCode = app;
}else if (testApp == "MessageDescription"){
messageText = app;
}
}
}
}
}

bye
Go to:   
Mobile view