XSLT to map source to target - xslt

I have a source which has a element personOrBusiness
<xsd:element name="personOrBusiness" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="business"/>
<xsd:enumeration value="person"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
I want this to be mapped to FirmOrPerson any idea what xslt map should i write.
<element name="ContactParty">
<complexType>
<sequence>
<element name="Language" type="string"/>
<element name="Service" type="string"/>
<element name="ContactRole" type="string"/>
<element name="FirmOrPerson" type="string"/>
<element name="Address" minOccurs="0">
<complexType>
<sequence>
<element name="Street" type="string"/>
<element name="HouseNumber" type="int"/>
<element name="Box" type="string"/>
<element name="City" type="string"/>
<element name="ZIPCode" type="int"/>
<element name="State" type="string"/>
<element name="Region" type="string"/>
<element name="Country" type="string"/>
<element name="isInCityLimit" type="boolean"/>
</sequence>
</complexType>
</element>
<choice>
<element name="Firm">
<complexType>
<sequence>
<element name="legalForm" type="string"/>
<element name="legalName" type="string"/>
<element name="EnterpriseNumber" type="string"/>
<element name="NACEcode" type="string"/>
</sequence>
</complexType>
</element>
<element name="Person">
<complexType>
<sequence>
<element name="Title" type="string"/>
<element name="LastName" type="string"/>
<element name="firstName" type="string"/>
<element name="NationalRegistrationNumber" type="string"/>
<element name="PhoneType" type="string"/>
<element name="Phone" type="string"/>
</sequence>
</complexType>
</element>
</choice>
</sequence>
</complexType>
</element>

Google for xsl:choose and xsl:element
http://www.w3schools.com/xsl/el_choose.asp
http://www.w3schools.com/XSL/el_element.asp

Related

Select all elements that don't have a child with 2 specific attributes

I have a problem with for xsl:foreach and the select xpath
<LIST>
<ELEMENT name="QX25">
<ELEMENT name="QX55A" value="1" />
<ELEMENT name="QX55B" value="2" />
<ELEMENT name="QX55C" value="xyz" />
<ELEMENT name="QX55D" value="dzy" />
</ELEMENT>
<ELEMENT name="QX55">
<ELEMENT name="QX55A" value="1" />
<ELEMENT name="QX55B" value="2" />
<ELEMENT name="QX55C" value="xyz" />
<ELEMENT name="QX55D" value="dzy" />
</ELEMENT>
<ELEMENT name="QX55">
<ELEMENT name="QX55A" value="2" />
<ELEMENT name="QX55B" value="1" />
<ELEMENT name="QX55C" value="dzy" />
<ELEMENT name="QX55D" value="xyz" />
<ELEMENT name="QX55E" value="X" />
</ELEMENT>
<ELEMENT name="QX55">
<ELEMENT name="QX55A" value="3" />
<ELEMENT name="QX55B" value="2" />
<ELEMENT name="QX55C" value="xyz" />
<ELEMENT name="QX55E" value="X" />
</ELEMENT>
<ELEMENT name="QX55">
<ELEMENT name="QX55A" value="4" />
<ELEMENT name="QX55B" value="3" />
<ELEMENT name="QX55C" value="xyz" />
<ELEMENT name="QX55E" value="P" />
</ELEMENT>
</LIST>
I want to get all the LIST/ELEMENT with name QX55 that DO NOT have a child ELEMENT which name="QX55E" and value="X".
any other value is fine as well as not having a child ELEMENT with name="QX55E" at all.
This means I would like to have the following result:
<ELEMENT name="QX55">
<ELEMENT name="QX55A" value="1" />
<ELEMENT name="QX55B" value="2" />
<ELEMENT name="QX55C" value="xyz" />
<ELEMENT name="QX55D" value="dzy" />
</ELEMENT>
<ELEMENT name="QX55">
<ELEMENT name="QX55A" value="4" />
<ELEMENT name="QX55B" value="3" />
<ELEMENT name="QX55C" value="xyz" />
<ELEMENT name="QX55E" value="P" />
</ELEMENT>
what I have tried:
<xsl:for-each select="/LIST/ELEMENT[#name='QX55']/ELEMENT[not(#name='QX55E' and #value='X')]/../.">
Can anyone help?
Use the path /LIST/ELEMENT[#name='QX55'][not(ELEMENT[#name = 'QX55E' and #value = 'X' ])].
You could use the count() function:
<xsl:for-each select=" /LIST/ELEMENT[ #name='QX55' and count( ELEMENT[ #name='QX55E' and #value='X' ] ) = 0 ] " >

wso2DSS generate web services not working with parameters

I have a wso2esb4.8.1 with features for wso2DSS. i have generate web service inthis url:
http://ec2-54-221-93-14.compute-1.amazonaws.com:9764/services/wsuaecd?tryit#
this is the xml for the web service
<data name="wsuaecd" serviceNamespace="Wsuaecd">
<config id="default">
<property name="carbon_datasource_name">UAECD</property>
</config>
<query id="select_with_key_bd_direccion_uaecd_query" useConfig="default">
<sql>SELECT id_direccion, tipo_identificacion, identificacion, nombre_propietario, primer_apellido, segundo_apellido, direccion_real, cod_barrio, nombre_barrio, cod_localidad, nombre_localidad, cod_upz, nombre_upz, cod_estrato, chip FROM public.bd_direccion_uaecd WHERE id_direccion=?</sql>
<sql dialect="postgresql">SELECT id_direccion, tipo_identificacion, identificacion, nombre_propietario, primer_apellido, segundo_apellido, direccion_real, cod_barrio, nombre_barrio, cod_localidad, nombre_localidad, cod_upz, nombre_upz, cod_estrato, chip FROM public.bd_direccion_uaecd WHERE id_direccion=?</sql>
<result element="bd_direccion_uaecdCollection" rowName="bd_direccion_uaecd">
<element column="id_direccion" name="id_direccion" xsdType="xs:long"/>
<element column="tipo_identificacion" name="tipo_identificacion" xsdType="xs:string"/>
<element column="identificacion" name="identificacion" xsdType="xs:string"/>
<element column="nombre_propietario" name="nombre_propietario" xsdType="xs:string"/>
<element column="primer_apellido" name="primer_apellido" xsdType="xs:string"/>
<element column="segundo_apellido" name="segundo_apellido" xsdType="xs:string"/>
<element column="direccion_real" name="direccion_real" xsdType="xs:string"/>
<element column="cod_barrio" name="cod_barrio" xsdType="xs:string"/>
<element column="nombre_barrio" name="nombre_barrio" xsdType="xs:string"/>
<element column="cod_localidad" name="cod_localidad" xsdType="xs:long"/>
<element column="nombre_localidad" name="nombre_localidad" xsdType="xs:string"/>
<element column="cod_upz" name="cod_upz" xsdType="xs:string"/>
<element column="nombre_upz" name="nombre_upz" xsdType="xs:string"/>
<element column="cod_estrato" name="cod_estrato" xsdType="xs:long"/>
<element column="chip" name="chip" xsdType="xs:string"/>
</result>
<param name="id_direccion" ordinal="1" sqlType="BIGINT"/>
</query>
<query id="select_all_bd_direccion_uaecd_query" useConfig="default">
<sql>SELECT id_direccion, tipo_identificacion, identificacion, nombre_propietario, primer_apellido, segundo_apellido, direccion_real, cod_barrio, nombre_barrio, cod_localidad, nombre_localidad, cod_upz, nombre_upz, cod_estrato, chip FROM public.bd_direccion_uaecd</sql>
<properties>
<property name="forceJDBCBatchRequests">false</property>
<property name="maxRows">100</property>
</properties>
<sql dialect="postgresql">SELECT id_direccion, tipo_identificacion, identificacion, nombre_propietario, primer_apellido, segundo_apellido, direccion_real, cod_barrio, nombre_barrio, cod_localidad, nombre_localidad, cod_upz, nombre_upz, cod_estrato, chip FROM public.bd_direccion_uaecd</sql>
<result element="bd_direccion_uaecdCollection" rowName="bd_direccion_uaecd">
<element column="id_direccion" name="id_direccion" xsdType="xs:long"/>
<element column="tipo_identificacion" name="tipo_identificacion" xsdType="xs:string"/>
<element column="identificacion" name="identificacion" xsdType="xs:string"/>
<element column="nombre_propietario" name="nombre_propietario" xsdType="xs:string"/>
<element column="primer_apellido" name="primer_apellido" xsdType="xs:string"/>
<element column="segundo_apellido" name="segundo_apellido" xsdType="xs:string"/>
<element column="direccion_real" name="direccion_real" xsdType="xs:string"/>
<element column="cod_barrio" name="cod_barrio" xsdType="xs:string"/>
<element column="nombre_barrio" name="nombre_barrio" xsdType="xs:string"/>
<element column="cod_localidad" name="cod_localidad" xsdType="xs:long"/>
<element column="nombre_localidad" name="nombre_localidad" xsdType="xs:string"/>
<element column="cod_upz" name="cod_upz" xsdType="xs:string"/>
<element column="nombre_upz" name="nombre_upz" xsdType="xs:string"/>
<element column="cod_estrato" name="cod_estrato" xsdType="xs:long"/>
<element column="chip" name="chip" xsdType="xs:string"/>
</result>
</query>
<operation name="select_with_key_bd_direccion_uaecd_operation">
<call-query href="select_with_key_bd_direccion_uaecd_query">
<with-param name="id_direccion" query-param="id_direccion"/>
</call-query>
</operation>
<operation name="select_all_bd_direccion_uaecd_operation">
<call-query href="select_all_bd_direccion_uaecd_query"/>
</operation>
</data>
The response for the queries with parameters is:
<axis2ns104:DataServiceFault xmlns:axis2ns104="http://ws.wso2.org/dataservice">DS Fault Message: Error in 'CallQuery.extractParams', cannot find parameter with type:query-param name:id_direccion
</axis2ns104:DataServiceFault>
does anyone has thesame issue? ithink is related with the configuration, but im pretty new in wso2 .
thanks in advanced.
Your question feels similiar to my question.
Data Service fails when deployed with ESB
If our questions are the same then you will be able to solve your problem by simply using DSS and not ESB together.
Create an instance with DSS only and verify this resolves your issue.

WSDL: No element type is defined for message

I'm creating a service orchestration using Eclipse BPEL Designer plugin and i have a problem with the WSDL file that it generates automatically.
Here is the WSDL:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.invocation.import" xmlns:vprop="http://docs.oasis-open.org/wsbpel/2.0/varprop" xmlns:wsdl="http://services.lolsystem.it" name="ImportOrchestration" targetNamespace="http://ws.invocation.import">
<plnk:partnerLinkType name="ImportType">
<plnk:role name="ImportRole" portType="wsdl:ImportServicePortType"/>
</plnk:partnerLinkType>
<import location="ImportModule.wsdl" namespace="http://services.italsystem.it"/>
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://ws.invocation.import">
<element name="ImportOrchestrationRequest" type="tns:ImportOrchestrationReqType">
</element>
<element name="singleEntry">
<complexType>
<sequence>
<element minOccurs="0" name="name" nillable="true" type="string"/>
<element minOccurs="0" name="content" nillable="true" type="base64Binary"/>
</sequence>
</complexType>
</element>
<element name="ImportOrchestrationResponse">
<complexType>
<sequence>
<element name="result" type="string"/>
</sequence>
</complexType>
</element>
<complexType name="ImportOrchestrationReqType">
<sequence minOccurs="1" maxOccurs="unbounded">
<element name="file" type="tns:SingleFile"></element>
</sequence>
</complexType>
<complexType name="SingleFile">
<sequence>
<element name="name" type="string"></element>
<element name="content" type="base64Binary"></element>
</sequence>
</complexType>
</schema>
</types>
<message name="ImportOrchestrationRequestMessage">
<part name="payload" type="tns:ImportOrchestrationReqType"/>
</message>
<message name="ImportOrchestrationResponseMessage">
<part element="tns:ImportOrchestrationResponse" name="payload"/>
</message>
<!-- portType implemented by the ImportOrchestration BPEL process -->
<portType name="ImportOrchestration">
<operation name="process">
<input message="tns:ImportOrchestrationRequestMessage"/>
<output message="tns:ImportOrchestrationResponseMessage"/>
</operation>
</portType>
<plnk:partnerLinkType name="ImportOrchestration">
<plnk:role name="ImportOrchestrationProvider" portType="tns:ImportOrchestration"/>
</plnk:partnerLinkType>
<binding name="ImportOrchestrationBinding" type="tns:ImportOrchestration">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="process">
<soap:operation soapAction="http://ws.invocation.import/process"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="ImportOrchestration">
<port binding="tns:ImportOrchestrationBinding" name="ImportOrchestrationPort">
<soap:address location="http://localhost:8080/ode/processes/ImportOrchestration"/>
</port>
</service>
</definitions>
Now, the problem is that Eclipse for Eclipse validator the WSDL is well formed.
I'm using Apache ODE as a BPEL engine, who is based on Axis2.
The problemi is that Axis engine give me an error when i try to deploy my BPEL proces, and it is:
"No element type is defined for message ImportOrchestrationRequestMessage"
Does someone can give me some advice to understand this error and how to correct it?
thanks in advance :)
Can you try following
<message name="ImportOrchestrationRequestMessage">
<part name="payload" element="tns:ImportOrchestrationRequest"/>
</message>
The problem is your binding is document literal, in that case the message part should be configured by using "element" rather than the "type"
HTH

Coldfusion How to authenticate webservice getShipmentSimpleQuote of WWEx?

How to invoke "getShipmentSimpleQuote" webservice from "Worldwide Express Freight Quote Web Service"? I am trying to invoke/consume this webservice but i am getting error saying "Invalid authentication info".
Here is wsdl file data:
WWEXFreightQuoteService.wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://www.wwexship.com" xmlns:impl="http://www.wwexship.com" xmlns:intf="http://www.wwexship.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.wwexship.com" elementFormDefault="qualified">
<complexType name="AuthenticationToken">
<sequence>
<element name="loginId" nillable="true" type="xsd:string"/>
<element name="password" nillable="true" type="xsd:string"/>
<element name="licenseKey" nillable="true" type="xsd:string"/>
<element name="accountNumber" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<element name="AuthenticationToken" type="impl:AuthenticationToken" maxOccurs="1"/>
<complexType name="QuoteLineItem">
<sequence>
<element name="nmfcClass" nillable="true" type="xsd:string"/>
<element name="weight" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfQuoteLineItem">
<sequence>
<element name="lineItem" nillable="true" type="impl:QuoteLineItem" maxOccurs="unbounded"/>
</sequence>
</complexType>
<complexType name="FreightShipmentQuoteRequest">
<sequence>
<element name="senderCity" nillable="true" type="xsd:string"/>
<element name="senderState" nillable="true" type="xsd:string"/>
<element name="senderZip" nillable="true" type="xsd:string"/>
<element name="receiverCity" nillable="true" type="xsd:string"/>
<element name="receiverState" nillable="true" type="xsd:string"/>
<element name="receiverZip" nillable="true" type="xsd:string"/>
<element name="lineItems" nillable="true" type="impl:ArrayOfQuoteLineItem"/>
<element name="hazmatShipment" nillable="true" type="xsd:string"/>
<element name="insidePickup" nillable="true" type="xsd:string"/>
<element name="liftgatePickup" nillable="true" type="xsd:string"/>
<element name="residentialPickup" nillable="true" type="xsd:string"/>
<element name="tradeshowPickup" nillable="true" type="xsd:string"/>
<element name="constructionSitePickup" nillable="true" type="xsd:string"/>
<element name="insideDelivery" nillable="true" type="xsd:string"/>
<element name="liftgateDelivery" nillable="true" type="xsd:string"/>
<element name="residentialDelivery" nillable="true" type="xsd:string"/>
<element name="tradeshowDelivery" nillable="true" type="xsd:string"/>
<element name="constructionSiteDelivery" nillable="true" type="xsd:string"/>
<element name="notifyBeforeDelivery" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<element name="freightShipmentQuoteRequest" type="impl:FreightShipmentQuoteRequest"/>
<complexType name="ErrorDescription">
<sequence>
<element name="errorDescription" nillable="true" type="xsd:string" maxOccurs="unbounded"/>
</sequence>
</complexType>
<complexType name="CarrierQuoteResult">
<sequence>
<element name="carrierName" nillable="true" type="xsd:string"/>
<element name="carrierSCAC" nillable="true" type="xsd:string"/>
<element name="totalPrice" nillable="true" type="xsd:string"/>
<element name="transitDays" nillable="true" type="xsd:string"/>
<element name="interline" nillable="true" type="xsd:string"/>
<element name="guaranteedService" nillable="true" type="xsd:string"/>
<element name="highCostDeliveryShipment" nillable="true" type="xsd:string"/>
<element name="nmfcRequired" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfCarrierQuoteResult">
<sequence>
<element name="carrierQuoteResult" nillable="true" type="impl:CarrierQuoteResult" maxOccurs="unbounded"/>
</sequence>
</complexType>
<complexType name="FreightShipmentQuoteResponse">
<sequence>
<element name="responseStatusCode" nillable="true" type="xsd:string"/>
<element name="responseStatusDescription" nillable="true" type="xsd:string"/>
<element name="errorDescriptions" nillable="true" type="impl:ErrorDescription"/>
<element name="quoteResults" nillable="true" type="impl:ArrayOfCarrierQuoteResult"/>
</sequence>
</complexType>
<element name="freightShipmentQuoteResponse" type="impl:FreightShipmentQuoteResponse"/>
</schema>
</wsdl:types>
<wsdl:message name="getShipmentSimpleQuoteResponse">
<wsdl:part name="freightShipmentQuoteResponse" element="impl:freightShipmentQuoteResponse"/>
</wsdl:message>
<wsdl:message name="FreightShipmentQuoteRequestHeaders">
<wsdl:part name="authenticationToken" element="impl:AuthenticationToken"/>
</wsdl:message>
<wsdl:message name="getShipmentSimpleQuoteRequest">
<wsdl:part name="freightShipmentQuoteRequest" element="impl:freightShipmentQuoteRequest"/>
</wsdl:message>
<wsdl:portType name="FreightShipmentQuote">
<wsdl:operation name="getShipmentSimpleQuote" parameterOrder="freightShipmentQuoteRequest">
<wsdl:input name="getShipmentSimpleQuoteRequest" message="impl:getShipmentSimpleQuoteRequest"/>
<wsdl:output name="getShipmentSimpleQuoteResponse" message="impl:getShipmentSimpleQuoteResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="FreightShipmentQuoteSoapBinding" type="impl:FreightShipmentQuote">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getShipmentSimpleQuote">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getShipmentSimpleQuoteRequest">
<wsdlsoap:body use="literal"/>
<wsdlsoap:header message="impl:FreightShipmentQuoteRequestHeaders" part="authenticationToken" use="literal">
</wsdlsoap:header>
</wsdl:input>
<wsdl:output name="getShipmentSimpleQuoteResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="FreightShipmentQuoteService">
<wsdl:port name="FreightShipmentQuote" binding="impl:FreightShipmentQuoteSoapBinding">
<wsdlsoap:address location="http://www.wwexship.com/webServices/services/FreightShipmentQuote"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
<br/>
My coldfusion code to consume/call the webservice is-<br/>
<b>consume.cfm</b>
<!--- items data --->
<cfset items = arrayNew(1) />
<cfset str = structNew() />
<cfset str.nmfcClass = "apple" />
<cfset str.weight = "15" />
<cfset arrayAppend(items, str) />
<!--- freightShipmentQuoteRequest data--->
<cfset st = structNew() />
<cfset st.senderCity = "Freeport" />
<cfset st.senderState = "NY" />
<cfset st.senderZip = "11520" />
<cfset st.receiverCity = "Staten Island" />
<cfset st.receiverState = "NY" />
<cfset st.receiverZip = "10314" />
<cfset st.lineItems = "#items#" />
<cfset st.hazmatShipment = "N" />
<cfset st.insidePickup = "N" />
<cfset st.liftgatePickup = "N" />
<cfset st.residentialPickup = "N" />
<cfset st.tradeshowPickup = "N" />
<cfset st.constructionSitePickup = "N" />
<cfset st.insideDelivery = "N" />
<cfset st.liftgateDelivery = "N" />
<cfset st.residentialDelivery = "N" />
<cfset st.tradeshowDelivery = "N" />
<cfset st.constructionSiteDelivery = "N" />
<cfset st.notifyBeforeDelivery = "N" />
<cfoutput>
<cfset shipService = CreateObject("webservice","http://www.wwexship.com/webServices/services/FreightShipmentQuote?wsdl")>
<cfdump var="#shipService#">
<cfset response1=shipService.getShipmentSimpleQuote(#st#)>
<cfset response=shipService.getShipmentSimpleQuote(#st#)>
<cfdump var="#response#">
<cfdump var="#response.getResponseStatusCode()#">
<cfdump var="#response.getResponseStatusDescription()#">
<cfdump var="#response.getErrorDescriptions()#">
</cfoutput>
I am unable to authenticate this webservice my login credentials are-
(1) loginId = copssship
(2) password = password
(3) licenseKey = hhrWQ7RMJEDKJMh4
(4) accountNumber = W922601302
Please suggest how to authenticate this webservice?
I have implemented http://www.wwexship.com web service in PHP. It is working fine.
<?php
$items = array();
$items[] = array('nmfcClass' => '50','weight' => '10');
$items[] = array('nmfcClass' => '50','weight' => '20');
$auth = Array('loginId' => "your Id", 'password' => "Your Pass",'licenseKey'=>'Your key','accountNumber'=>'Your account no,') ;
$client = new SoapClient('wsdl.xml',array( 'trace' =>1));
$header = new SoapHeader('http://www.wwexship.com','AuthenticationToken',$auth,false);
$client->__setSoapHeaders(array($header));
$result = $client->getShipmentSimpleQuote(array('senderCity' => 'Freeport','senderState'=>'NY','senderZip'=>'11520','receiverCity'=>'Staten Island','receiverState'=>'NY', 'receiverZip'=>'10314','lineItems'=>$items));
echo '<pre>';
print_r($result);
I think I may have the answer. The Authentication info is specified as a header. ColdFusion provides an AddSoapRequestHeader() method for situations like this. It appears to want values either as text or XML. The code below will run and get you a success code. Note that as well as adding the header, I've changed the NMFC code to 300 and weight to 2. The service complained about the initial values.
shipService = CreateObject("webservice","http://www.wwexship.com/webServices/services/FreightShipmentQuote?wsdl");
doc = XmlNew();
doc.xmlRoot = XmlElemNew(doc, "http://www.wwexship.com", "AuthenticationToken");
loginId = XmlElemNew(doc, "http://www.wwexship.com", "loginId");
loginId.XmlText = "copssship";
loginId.XmlAttributes["xsi:type"] = "xsd:string";
doc.xmlRoot.XmlChildren[1] = loginId;
password = XmlElemNew(doc, "http://www.wwexship.com", "password");
password.XmlText = "password";
password.XmlAttributes["xsi:type"] = "xsd:string";
doc.xmlRoot.XmlChildren[2] = password;
licenseKey = XmlElemNew(doc, "http://www.wwexship.com", "licenseKey");
licenseKey.XmlText = "hhrWQ7RMJEDKJMh4";
licenseKey.XmlAttributes["xsi:type"] = "xsd:string";
doc.xmlRoot.XmlChildren[3] = licenseKey;
accountNumber = XmlElemNew(doc, "http://www.wwexship.com", "accountNumber");
accountNumber.XmlText = "W922601302";
accountNumber.XmlAttributes["xsi:type"] = "xsd:string";
doc.xmlRoot.XmlChildren[4] = accountNumber;
AddSOAPRequestHeader(shipService,"http://www.wwexship.com","authenticationToken",doc);
response=shipService.getShipmentSimpleQuote(st);

How to solve error while consuming WWEx webservice?

i am trying to consume webservice to get freight rate from webserivce "http://www.wwexship.com/webServices/services/FreightShipmentQuote?wsdl" and it is giving an error that "Web service operation getShipmentSimpleQuote with parameters {....} can not be found". whereas i am providing valid loginid,password, licensekey,accountnumber and other required details.
please suggest me how to consume this webservice?
wsdl file-
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://www.wwexship.com" xmlns:impl="http://www.wwexship.com" xmlns:intf="http://www.wwexship.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.wwexship.com" elementFormDefault="qualified">
<complexType name="AuthenticationToken">
<sequence>
<element name="loginId" nillable="true" type="xsd:string"/>
<element name="password" nillable="true" type="xsd:string"/>
<element name="licenseKey" nillable="true" type="xsd:string"/>
<element name="accountNumber" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<element name="AuthenticationToken" type="impl:AuthenticationToken" maxOccurs="1"/>
<complexType name="QuoteLineItem">
<sequence>
<element name="nmfcClass" nillable="true" type="xsd:string"/>
<element name="weight" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfQuoteLineItem">
<sequence>
<element name="lineItem" nillable="true" type="impl:QuoteLineItem" maxOccurs="unbounded"/>
</sequence>
</complexType>
<complexType name="FreightShipmentQuoteRequest">
<sequence>
<element name="senderCity" nillable="true" type="xsd:string"/>
<element name="senderState" nillable="true" type="xsd:string"/>
<element name="senderZip" nillable="true" type="xsd:string"/>
<element name="receiverCity" nillable="true" type="xsd:string"/>
<element name="receiverState" nillable="true" type="xsd:string"/>
<element name="receiverZip" nillable="true" type="xsd:string"/>
<element name="lineItems" nillable="true" type="impl:ArrayOfQuoteLineItem"/>
<element name="hazmatShipment" nillable="true" type="xsd:string"/>
<element name="insidePickup" nillable="true" type="xsd:string"/>
<element name="liftgatePickup" nillable="true" type="xsd:string"/>
<element name="residentialPickup" nillable="true" type="xsd:string"/>
<element name="tradeshowPickup" nillable="true" type="xsd:string"/>
<element name="constructionSitePickup" nillable="true" type="xsd:string"/>
<element name="insideDelivery" nillable="true" type="xsd:string"/>
<element name="liftgateDelivery" nillable="true" type="xsd:string"/>
<element name="residentialDelivery" nillable="true" type="xsd:string"/>
<element name="tradeshowDelivery" nillable="true" type="xsd:string"/>
<element name="constructionSiteDelivery" nillable="true" type="xsd:string"/>
<element name="notifyBeforeDelivery" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<element name="freightShipmentQuoteRequest" type="impl:FreightShipmentQuoteRequest"/>
<complexType name="ErrorDescription">
<sequence>
<element name="errorDescription" nillable="true" type="xsd:string" maxOccurs="unbounded"/>
</sequence>
</complexType>
<complexType name="CarrierQuoteResult">
<sequence>
<element name="carrierName" nillable="true" type="xsd:string"/>
<element name="carrierSCAC" nillable="true" type="xsd:string"/>
<element name="totalPrice" nillable="true" type="xsd:string"/>
<element name="transitDays" nillable="true" type="xsd:string"/>
<element name="interline" nillable="true" type="xsd:string"/>
<element name="guaranteedService" nillable="true" type="xsd:string"/>
<element name="highCostDeliveryShipment" nillable="true" type="xsd:string"/>
<element name="nmfcRequired" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfCarrierQuoteResult">
<sequence>
<element name="carrierQuoteResult" nillable="true" type="impl:CarrierQuoteResult" maxOccurs="unbounded"/>
</sequence>
</complexType>
<complexType name="FreightShipmentQuoteResponse">
<sequence>
<element name="responseStatusCode" nillable="true" type="xsd:string"/>
<element name="responseStatusDescription" nillable="true" type="xsd:string"/>
<element name="errorDescriptions" nillable="true" type="impl:ErrorDescription"/>
<element name="quoteResults" nillable="true" type="impl:ArrayOfCarrierQuoteResult"/>
</sequence>
</complexType>
<element name="freightShipmentQuoteResponse" type="impl:FreightShipmentQuoteResponse"/>
</schema>
</wsdl:types>
<wsdl:message name="getShipmentSimpleQuoteResponse">
<wsdl:part name="freightShipmentQuoteResponse" element="impl:freightShipmentQuoteResponse"/>
</wsdl:message>
<wsdl:message name="FreightShipmentQuoteRequestHeaders">
<wsdl:part name="authenticationToken" element="impl:AuthenticationToken"/>
</wsdl:message>
<wsdl:message name="getShipmentSimpleQuoteRequest">
<wsdl:part name="freightShipmentQuoteRequest" element="impl:freightShipmentQuoteRequest"/>
</wsdl:message>
<wsdl:portType name="FreightShipmentQuote">
<wsdl:operation name="getShipmentSimpleQuote" parameterOrder="freightShipmentQuoteRequest">
<wsdl:input name="getShipmentSimpleQuoteRequest" message="impl:getShipmentSimpleQuoteRequest"/>
<wsdl:output name="getShipmentSimpleQuoteResponse" message="impl:getShipmentSimpleQuoteResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="FreightShipmentQuoteSoapBinding" type="impl:FreightShipmentQuote">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getShipmentSimpleQuote">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getShipmentSimpleQuoteRequest">
<wsdlsoap:body use="literal"/>
<wsdlsoap:header message="impl:FreightShipmentQuoteRequestHeaders" part="authenticationToken" use="literal">
</wsdlsoap:header>
</wsdl:input>
<wsdl:output name="getShipmentSimpleQuoteResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="FreightShipmentQuoteService">
<wsdl:port name="FreightShipmentQuote" binding="impl:FreightShipmentQuoteSoapBinding">
<wsdlsoap:address location="http://www.wwexship.com/webServices/services/FreightShipmentQuote"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
code that calls webservice is-
<!--- items data --->
<cfset items = arrayNew(1) />
<cfset str = structNew() />
<cfset str.nmfcClass = "apple" />
<cfset str.weight = "15" />
<cfset arrayAppend(items, str) />
<!--- freightShipmentQuoteRequest data--->
<cfset st = structNew() />
<cfset st.senderCity = "Freeport" />
<cfset st.senderState = "NY" />
<cfset st.senderZip = "11520" />
<cfset st.receiverCity = "Staten Island" />
<cfset st.receiverState = "NY" />
<cfset st.receiverZip = "10314" />
<cfset st.lineItems = "#items#" />
<cfset st.hazmatShipment = "N" />
<cfset st.insidePickup = "N" />
<cfset st.liftgatePickup = "N" />
<cfset st.residentialPickup = "N" />
<cfset st.tradeshowPickup = "N" />
<cfset st.constructionSitePickup = "N" />
<cfset st.insideDelivery = "N" />
<cfset st.liftgateDelivery = "N" />
<cfset st.residentialDelivery = "N" />
<cfset st.tradeshowDelivery = "N" />
<cfset st.constructionSiteDelivery = "N" />
<cfset st.notifyBeforeDelivery = "N" />
<cfinvoke
webservice="http://www.wwexship.com/webServices/services/FreightShipmentQuote?wsdl"
method="getShipmentSimpleQuote"
username="copssship"
password="password"
returnvariable="retTemp">
<cfheader name="loginId" value="copssship">
<cfheader name="password" value="password">
<cfheader name="licenseKey" value="hhrWQ7RMJEDKJMh4">
<cfheader name="accountNumber" value="W922601302">
<!---<cfheader name="AuthenticationToken" value="#stAuth#" />--->
<cfinvokeargument name="freightShipmentQuoteRequest" value="#st#" />
</cfinvoke>
<cfdump var="#retTemp#"><br/>
<cfoutput>
<b>retTemp:</b>#retTemp#<br/><br/>
<b>retTemp.ResponseStatusCode:</b>#retTemp.ResponseStatusCode#<br/>
<b>retTemp.responseStatusDescription:</b>#retTemp.responseStatusDescription#<br/>
<b>retTemp.errorDescriptions:</b>#retTemp.errorDescriptions[1]#<br/>
</cfoutput>
It looks very much to me like there's a mismatch between the arcuments you're passing and those expected. Here's 2 things I'd try:
1: Use foo=CreateObject("webservice","http://server/wsdl"); then dump the object. You should see methods and arguments on it, which may differ from your arguments above.
2: Download and install Fiddler. Then start it and add proxyServer="localhost" proxyPort="8888" to your call. ColdFusion will now route all web service requests through Fiddler and you can examine what's being passed to and from the remote server. It's quite a powerful technique for this kind of thing.
I think Chris is right, you need to be passing a struct as an argument. I can invoke the service with the code below:
<cfoutput>
<cfset shipService = CreateObject("webservice","http://www.wwexship.com/webServices/services/FreightShipmentQuote?wsdl")>
<cfdump var="#shipService#">
<cfset response=shipService.getShipmentSimpleQuote({})>
<cfdump var="#response#">
<cfdump var="#response.getResponseStatusCode()#">
<cfdump var="#response.getResponseStatusDescription()#">
The service is returning a fail code, but it does execute. The WSDL defines all members of FreightShipmentQuoteRequest as nillabla, which is why my code works, but when you come to implement is properly, you may need to use an array of structs for the lineItems element.
I'm unable to test this solution as i'm not able to login to the service, however it looks like getShipmentSimpleQuote takes a single struct argument called "freightShipmentQuoteRequest", with the keys you are trying to pass as arguments within it.
<cfinvoke
webservice="http:.....FreightShipmentQuote?wsdl"
method="getShipmentSimpleQuote"
returnvariable="aTemp">
<cfinvokeargument name="freightShipmentQuoteRequest" value="#{
"senderCity" = "Freeport",
"senderState" = "NY",
....
}#" />
</cfinvoke>
If that doesn't work you could try prefexing all your fields "freightShipmentQuoteRequest." ie.
<cfinvokeargument name="freightShipmentQuoteRequest.senderCity" value="Freeport"/>
What i can not see in the wsdl is any reference to the login parameters.