From: | Stein Goering |
To: | Rick Strahl |
*** Create the SOAP header instance loBridge.CreateInstanceOnType(loService,"authCredentialsValue","msu_WebPayment.authCredentials") loBridge.SetPropertyEx(loService,"authCredentialsValue.region",lcRegion) loBridge.SetPropertyEx(loService,"authCredentialsValue.passphrase",lcPassPhrase)
Now I'm getting an "Unknown Name" error when I try to call a service method. Working with their techs to track it down- hopefully it's not due to an issue with the SOAP header...
--stein
Ah - that object is a Soap header so it has to be sent on every request. There's no method that maps this but you have to set the headers.
There's limited support for SoapHeaders in the .NET proxy but if your class exists that means it most likely will work.
Here's the help topic:
http://www.west-wind.com/wsdlgenerator/docs?page=_2tz19ezkl.htm
+++ Rick ---
Yes, the .NET code includes this:
publicpartialclass authCredentials : System.Web.Services.Protocols.SoapHeader {publicstring region; publicstring passphrase; } }
How do I work with that from the VFP side?
--stein
Was a .NET class generated for authCredentials? It should be there.
+++ Rick ---
Usually dealing with objects produced by the proxy generator is pretty intuitive - I just assign properties and make the calls. But I've run across a situation that I don't know how to handle. I've been given a couple of validation strings to populate the region and passphrase elements shown here:
<xs:elementname="authCredentials"><xs:complexType><xs:all><xs:elementname="region" type="xs:string"/><xs:elementname="passphrase" type="xs:string"/></xs:all></xs:complexType></xs:element>
I've generated a proxy object based on the WSDL shown below, but I can't see anything in its interface that lets me get to those properties. The specs aren't exactly clear, but I need to get a result from getCMUrl and my impression is that I need to provide those credentials before I can make the call. How do I do that?
--stein
<?xmlversion="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:axis2="http://finance.asg.itc.montana.edu/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://finance.asg.itc.montana.edu/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://finance.asg.itc.montana.edu/"><wsdl:documentation>msu_WebPayment</wsdl:documentation><wsdl:types><xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://finance.asg.itc.montana.edu/xsd"><xs:complexTypename="Exception"><xs:sequence><xs:elementminOccurs="0" name="Exception" nillable="true" type="xs:anyType"/></xs:sequence></xs:complexType><xs:elementname="Exception"><xs:complexType><xs:sequence><xs:elementminOccurs="0" name="Exception" nillable="true" type="ns:Exception"/></xs:sequence></xs:complexType></xs:element><xs:elementname="getCMUrl"><xs:complexType><xs:sequence><xs:elementname="orderType" type="xs:string"/><xs:elementminOccurs="0" name="orderNumber" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="orderName" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="orderDescription" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="amount" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="orderFee" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="amountDue" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="currentAmountDue" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="balance" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="currentBalance" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="dueDate" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="userChoice1" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="userChoice2" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="userChoice3" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="userChoice4" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="userChoice5" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="userChoice6" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="userChoice7" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="userChoice8" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="userChoice9" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="userChoice10" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="paymentMethod" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="streetOne" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="streetTwo" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="city" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="state" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="zip" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="country" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="daytimePhone" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="eveningPhone" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="email" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="redirectUrl" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="redirectUrlParameters" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="retriesAllowed" nillable="true" type="xs:string"/><xs:elementminOccurs="0" name="contentEmbedded" nillable="true" type="xs:string"/></xs:sequence></xs:complexType></xs:element><xs:elementname="authCredentials"><xs:complexType><xs:all><xs:elementname="region" type="xs:string"/><xs:elementname="passphrase" type="xs:string"/></xs:all></xs:complexType></xs:element><xs:elementname="getCMHash"><xs:complexType><xs:sequence><xs:elementname="stringToHash" nillable="true" type="xs:string"/></xs:sequence></xs:complexType></xs:element><xs:elementname="getCMHashResponse"><xs:complexType><xs:sequence><xs:elementminOccurs="0" name="return" nillable="true" type="xs:string"/></xs:sequence></xs:complexType></xs:element><xs:elementname="getCMUrlResponse"><xs:complexType><xs:sequence><xs:elementminOccurs="0" name="return" nillable="true" type="xs:string"/></xs:sequence></xs:complexType></xs:element><xs:elementname="validateCMReceipt"><xs:complexType><xs:sequence><xs:elementname="stringToHash" nillable="true" type="xs:string"/><xs:elementname="hashToValidate" nillable="true" type="xs:string"/></xs:sequence></xs:complexType></xs:element><xs:elementname="validateCMReceiptResponse"><xs:complexType><xs:sequence><xs:elementminOccurs="0" name="return" nillable="true" type="xs:string"/></xs:sequence></xs:complexType></xs:element></xs:schema></wsdl:types><wsdl:messagename="validateCMReceiptRequest"><wsdl:partname="parameters" element="ns:validateCMReceipt"/></wsdl:message><wsdl:messagename="validateCMReceiptRequestHeader"><wsdl:partname="request_header" element="ns:authCredentials"/></wsdl:message><wsdl:messagename="validateCMReceiptResponse"><wsdl:partname="parameters" element="ns:validateCMReceiptResponse"/></wsdl:message><wsdl:messagename="Exception"><wsdl:partname="parameters" element="ns:Exception"/></wsdl:message><wsdl:messagename="getCMHashRequest"><wsdl:partname="parameters" element="ns:getCMHash"/></wsdl:message><wsdl:messagename="getCMHashRequestHeader"><wsdl:partname="request_header" element="ns:authCredentials"/></wsdl:message><wsdl:messagename="getCMHashResponse"><wsdl:partname="parameters" element="ns:getCMHashResponse"/></wsdl:message><wsdl:messagename="getCMUrlRequest"><wsdl:partname="parameters" element="ns:getCMUrl"/></wsdl:message><wsdl:messagename="getCMUrlRequestHeader"><wsdl:partname="request_header" element="ns:authCredentials"/></wsdl:message><wsdl:messagename="getCMUrlResponse"><wsdl:partname="parameters" element="ns:getCMUrlResponse"/></wsdl:message><wsdl:portTypename="msu_WebPaymentPortType"><wsdl:operationname="validateCMReceipt"><wsdl:input message="axis2:validateCMReceiptRequest" wsaw:Action="urn:validateCMReceipt"/><wsdl:output message="axis2:validateCMReceiptResponse" wsaw:Action="urn:validateCMReceiptResponse"/><wsdl:fault message="axis2:Exception" name="Exception" wsaw:Action="urn:validateCMReceiptException"/></wsdl:operation><wsdl:operationname="getCMHash"><wsdl:input message="axis2:getCMHashRequest" wsaw:Action="urn:getCMHash"/><wsdl:output message="axis2:getCMHashResponse" wsaw:Action="urn:getCMHashResponse"/><wsdl:fault message="axis2:Exception" name="Exception" wsaw:Action="urn:getCMHashException"/></wsdl:operation><wsdl:operationname="getCMUrl"><wsdl:input message="axis2:getCMUrlRequest" wsaw:Action="urn:getCMUrl"/><wsdl:output message="axis2:getCMUrlResponse" wsaw:Action="urn:getCMUrlResponse"/><wsdl:fault message="axis2:Exception" name="Exception" wsaw:Action="urn:getCMUrlException"/></wsdl:operation></wsdl:portType><wsdl:bindingname="msu_WebPaymentSoap11Binding" type="axis2:msu_WebPaymentPortType"><soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/><wsdl:operationname="validateCMReceipt"><soap:operation soapAction="urn:validateCMReceipt" style="document"/><wsdl:input><soap:bodyuse="literal"/><soap12:headeruse="literal" part="request_header" message="axis2:validateCMReceiptRequestHeader"/></wsdl:input><wsdl:output><soap:bodyuse="literal"/></wsdl:output><wsdl:faultname="Exception"><soap:faultuse="literal" name="Exception"/></wsdl:fault></wsdl:operation><wsdl:operationname="getCMHash"><soap:operation soapAction="urn:getCMHash" style="document"/><wsdl:input><soap:bodyuse="literal"/><soap12:headeruse="literal" part="request_header" message="axis2:getCMHashRequestHeader"/></wsdl:input><wsdl:output><soap:bodyuse="literal"/></wsdl:output><wsdl:faultname="Exception"><soap:faultuse="literal" name="Exception"/></wsdl:fault></wsdl:operation><wsdl:operationname="getCMUrl"><soap:operation soapAction="urn:getCMUrl" style="document"/><wsdl:input><soap:bodyuse="literal"/><soap12:headeruse="literal" part="request_header" message="axis2:getCMUrlRequestHeader"/></wsdl:input><wsdl:output><soap:bodyuse="literal"/></wsdl:output><wsdl:faultname="Exception"><soap:faultuse="literal" name="Exception"/></wsdl:fault></wsdl:operation></wsdl:binding><wsdl:bindingname="msu_WebPaymentSoap12Binding" type="axis2:msu_WebPaymentPortType"><soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/><wsdl:operationname="validateCMReceipt"><soap12:operation soapAction="urn:validateCMReceipt" style="document"/><wsdl:input><soap12:bodyuse="literal"/><soap12:headeruse="literal" part="request_header" message="axis2:validateCMReceiptRequestHeader"/></wsdl:input><wsdl:output><soap12:bodyuse="literal"/></wsdl:output><wsdl:faultname="Exception"><soap12:faultuse="literal" name="Exception"/></wsdl:fault></wsdl:operation><wsdl:operationname="getCMHash"><soap12:operation soapAction="urn:getCMHash" style="document"/><wsdl:input><soap12:bodyuse="literal"/><soap12:headeruse="literal" part="request_header" message="axis2:getCMHashRequestHeader"/></wsdl:input><wsdl:output><soap12:bodyuse="literal"/></wsdl:output><wsdl:faultname="Exception"><soap12:faultuse="literal" name="Exception"/></wsdl:fault></wsdl:operation><wsdl:operationname="getCMUrl"><soap12:operation soapAction="urn:getCMUrl" style="document"/><wsdl:input><soap12:bodyuse="literal"/><soap12:headeruse="literal" part="request_header" message="axis2:getCMUrlRequestHeader"/></wsdl:input><wsdl:output><soap12:bodyuse="literal"/></wsdl:output><wsdl:faultname="Exception"><soap12:faultuse="literal" name="Exception"/></wsdl:fault></wsdl:operation></wsdl:binding><wsdl:bindingname="msu_WebPaymentHttpBinding" type="axis2:msu_WebPaymentPortType"><http:binding verb="POST"/><wsdl:operationname="validateCMReceipt"><http:operationlocation="msu_WebPayment/validateCMReceipt"/><wsdl:input><mime:contenttype="text/xml" part="validateCMReceipt"/></wsdl:input><wsdl:output><mime:contenttype="text/xml" part="validateCMReceipt"/></wsdl:output></wsdl:operation><wsdl:operationname="getCMHash"><http:operationlocation="msu_WebPayment/getCMHash"/><wsdl:input><mime:contenttype="text/xml" part="getCMHash"/></wsdl:input><wsdl:output><mime:contenttype="text/xml" part="getCMHash"/></wsdl:output></wsdl:operation><wsdl:operationname="getCMUrl"><http:operationlocation="msu_WebPayment/getCMUrl"/><wsdl:input><mime:contenttype="text/xml" part="getCMUrl"/></wsdl:input><wsdl:output><mime:contenttype="text/xml" part="getCMUrl"/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:servicename="msu_WebPayment"><wsdl:portname="msu_WebPaymentHttpSoap11Endpoint" binding="axis2:msu_WebPaymentSoap11Binding"><soap:addresslocation="https://sais.montana.edu:8080/axis2/services/msu_WebPayment"/></wsdl:port><wsdl:portname="msu_WebPaymentHttpSoap12Endpoint" binding="axis2:msu_WebPaymentSoap12Binding"><soap12:addresslocation="https://sais.montana.edu:8080/axis2/services/msu_WebPayment"/></wsdl:port><wsdl:portname="msu_WebPaymentHttpEndpoint" binding="axis2:msu_WebPaymentHttpBinding"><http:addresslocation="https://sais.montana.edu:8080/axis2/services/MSUWebPayment"/></wsdl:port></wsdl:service></wsdl:definitions>