Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I am having this same problem. I can only seem to get the Java Stub, but no returned (XML) information. Any ideas?
Copy link to clipboard
Copied
Code?
Either you got an XML string that needed to be parsed into an XML object, thus you should be able to output the string.
OR
You are getting an XML string thet needs to be cast into a string with the toString() function.
Copy link to clipboard
Copied
#tostring(ret)# = com.millinfo.webservices.SubmitInspection.ExecuteResponseExecuteResult@364bd7
#ret# =
object of com.millinfo.webservices.SubmitInspection.ExecuteResponseExecuteResult
Class Name com.millinfo.webservices.SubmitInspection.ExecuteResponseExecuteResult
Methods
Method Return Type
equals(java.lang.Object) boolean
getDeserializer(java.lang.String, java.lang.Class, javax.xml.namespace.QName) org.apache.axis.encoding.Deserializer
getSerializer(java.lang.String, java.lang.Class, javax.xml.namespace.QName) org.apache.axis.encoding.Serializer
getTypeDesc() org.apache.axis.description.TypeDesc
get_any() org.apache.axis.message.MessageElement[]
hashCode() int
set_any(org.apache.axis.message.MessageElement[]) void
Copy link to clipboard
Copied
SO are we dealing with XML data? A web-service may or my not be XML and XML may or may not be a web service.
If you are looking for the WSDL, which is XML formated information, you would need to be using the WSDL url.
Otherwise, I would expect you to be looking at the results of a web service method that is expected to return XML data.
Copy link to clipboard
Copied
Let's try posting this again.
Any help is appreciated. I've been banging my head for a couple days now. The client publishing this WebService says that the server is generating and returning XML, it just seems to be getting stuck in this Java Stub for some reason.
<!------Code----->
<cfinvoke refreshWSDL="yes" webservice="http://webservice?wsdl" method="Execute" returnvariable="ret">
<cfinvokeargument name="Header" value="#myHeader#"/>
<cfinvokeargument name="Data" value="#myData#"/>
</cfinvoke>
<cfdump var="#tostring(ret)#">
<cfdump var="#ret#">
<!------Code----->
tostring(ret) returns the Java Class/Stub name: com.millinfo.webservices.SubmitInspection.ExecuteResponseExecuteResult@364bd7
ret returns
object of com.millinfo.webservices.SubmitInspection.ExecuteResponseExecuteResult | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Class Name | com.millinfo.webservices.SubmitInspection.ExecuteResponseExecuteResult | ||||||||||||||||
Methods |
|
Copy link to clipboard
Copied
Have you tried what happens if you use some of those methods shown in your dump?
<cfdump var="#ret.getAny()#">
OR
<cfdump var="#ret.getTypeDesc()#>
I still find web services to be quite confusing and it usually takes me quite a bit of trial and error to get them working as expected.
Copy link to clipboard
Copied
array | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 |
|
object of org.apache.axis.description.TypeDesc | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Class Name | org.apache.axis.description.TypeDesc | ||||||||||||||||||||||||||||||||||||||
Methods |
| ||||||||||||||||||||||||||||||||||||||
Fields |
|
Copy link to clipboard
Copied
1. What is the signature in the WSDL? ie What type of object is returned?
2. Have you tried dumping the response with GetSoapResponse()?
Copy link to clipboard
Copied
1. WSDL Signature? It appears to be a Java Class/Stub?
2. Yeah, it returns:
struct | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
EVENTNAME | [empty string] | ||||||||||||||||||||||||||||
EXCEPTION |
|
Copy link to clipboard
Copied
1. WSDL Signature? It appears to be a Java Class/Stub?
No, I mean what is the actual xml code from the WSDL that defines what objects are expected and returned from the method you are calling
2. Yeah, it returns:
Did you pass in an instance of the webservice and call the method after invoking it? Something like:
<cfdump var="#res#"
Copy link to clipboard
Copied
1.
CALL
POST /SubmitInspection/Submitinspection.asmx HTTP/1.1
Host: webservicestest.millinfo.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://webservice/Execute"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Execute xmlns="http://webservice/">
<Header>string</Header>
<Data>string</Data>
</Execute>
</soap:Body>
</soap:Envelope>
RESPONSE
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ExecuteResponse xmlns="http://webservice/">
<ExecuteResult>xml</ExecuteResult>
</ExecuteResponse>
</soap:Body>
</soap:Envelope>
2. I sure did. Here's my code:
<cfinvoke refreshWSDL="yes" webservice="http://webservice/Submitinspection.asmx?wsdl" method="Execute" returnvariable="ret">
<cfinvokeargument name="Header" value="#myHeader#"/>
<cfinvokeargument name="Data" value="#myData#"/>
</cfinvoke>
<cfdump var="#GetSoapResponse(ret)#">
Copy link to clipboard
Copied
It looks like the code snippet in my last response got cut off. Here is the full response:
> 2. Yeah, it returns:
Did you pass in an instance of the webservice and call the method _after_ invoking it? Something like:
<!--- create the webservice object --->
<cfset ws = createObject("webservice", "yourWebservice?wsdl")>
<!--- call the method --->
<cfset ret = ws.yourMethodName(someParametersHere)>
<!--- check the response using the webservice object --->
<cfset res = GetSoapResponse(ws)>
<cfdump var="#res#">
Copy link to clipboard
Copied
I ran the code you supplied and got the following returned:
struct | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
EVENTNAME | [empty string] | ||||||||||||||||||||||||||||||||||
EXCEPTION |
|
Copy link to clipboard
Copied
MorganWood wrote:
1.
CALL
POST /SubmitInspection/Submitinspection.asmx HTTP/1.1
Host: webservicestest.millinfo.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://webservice/Execute"
Is that the request/response from a SOAP call or defintions from the actual wsdl file?
Copy link to clipboard
Copied
It's the definitions from the actual WSDL file.
Copy link to clipboard
Copied
It almost looks like getSOAPResponse won't work because the service is returning straight XML instead of SOAP...
Copy link to clipboard
Copied
Weird. I was under the impression the function works for any webservice response
http://livedocs.adobe.com/coldfusion/8/htmldocs/webservices_27.html
What happens if you try calling one of the methods on the ret.getAny() array? It looks like it contains xml nodes.
Copy link to clipboard
Copied
If I call <cfdump var="#ret.get_any().getLength()#"> I get:
Error Message: Either there are no methods with the specified method name and argument types or the getLength method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity.
Copy link to clipboard
Copied
It looks like ret.get_any() returns an array. So it should behave the same as a CF array. Try grabbing the first element. Then testing the methods.
<cfdump var="#arr[1].someMethodName()#"
Copy link to clipboard
Copied
Found it! It's at: #ret.get_any()[1].GetAsString())#.
Thanks for the help!
Copy link to clipboard
Copied
Trial and error I tell you.
That is what I have allways have to go through to conume other web services like this. Fetch, dump, experienment, fetch dump repeat over and over.
Glad you got it figured out.
Copy link to clipboard
Copied
Trial and error I tell you.
Test. Dump. (Lather. Rinse. Repeat.)