Hi All,
I've been struggling with this issue for a while. I am using the autogenerated code from Excel VBA to consume a web service which takes as input a complex type and returns a complex type. I keep getting the following error
Generic Custom Type Mapper:Element RequestKey could not be saved while saving type ItemRequest HRESULT=0x80070057: The parameter is incorrect.
I just can't figure out what's wrong. Can anyone help?
Below is the some code sniplets
Dim str_WSML As String
str_WSML = "<servicemapping>"
str_WSML = str_WSML & "<service name='ItemService_1'>"
str_WSML = str_WSML & "<using PROGID='MSOSOAP.GenericCustomTypeMapper30' cachable='0' ID='GCTM'/>"
str_WSML = str_WSML & "<types>"
str_WSML = str_WSML & "<type name='ChildItem' targetNamespace='http://schemas.rr.com/ns/2006/04/14/rmds/webservices/ItemService_1/types' uses='GCTM' targetClassName='struct_ChildItem'/>"
str_WSML = str_WSML & "<type name='Item' targetNamespace='http://schemas.rr.com/ns/2006/04/14/rmds/webservices/ItemService_1/types' uses='GCTM' targetClassName='struct_Item'/>"
str_WSML = str_WSML & "<type name='ItemRequest' targetNamespace='http://schemas.rr.com/ns/2006/04/14/rmds/webservices/ItemService_1/types' uses='GCTM' targetClassName='struct_ItemRequest'/>"
str_WSML = str_WSML & "<type name='ItemResponse' targetNamespace='http://schemas.rr.com/ns/2006/04/14/rmds/webservices/ItemService_1/types' uses='GCTM' targetClassName='struct_ItemResponse'/>"
str_WSML = str_WSML & "<type name='QoS' targetNamespace='http://schemas.rr.com/ns/2006/04/14/rmds/webservices/ItemService_1/types' uses='GCTM' targetClassName='struct_QoS'/>"
str_WSML = str_WSML & "<type name='RateInfo' targetNamespace='http://schemas.rr.com/ns/2006/04/14/rmds/webservices/ItemService_1/types' uses='GCTM' targetClassName='struct_RateInfo'/>"
str_WSML = str_WSML & "<type name='Status' targetNamespace='http://schemas.rr.com/ns/2006/04/14/rmds/webservices/ItemService_1/types' uses='GCTM' targetClassName='struct_Status'/>"
str_WSML = str_WSML & "<type name='TimelinessInfo' targetNamespace='http://schemas.rr.com/ns/2006/04/14/rmds/webservices/ItemService_1/types' uses='GCTM' targetClassName='struct_TimelinessInfo'/>"
str_WSML = str_WSML & "<type name='Field' targetNamespace='http://schemas.rr.com/ns/2006/04/14/rmds/webservices/omm' uses='GCTM' targetClassName='struct_Field'/>"
str_WSML = str_WSML & "<type name='ItemKey' targetNamespace='http://schemas.rr.com/ns/2006/04/14/rmds/webservices/omm' uses='GCTM' targetClassName='struct_ItemKey'/>"
str_WSML = str_WSML & "</types>"
str_WSML = str_WSML & "</service>"
str_WSML = str_WSML & "</servicemapping>"
Set sc_ItemService1 = New SoapClient30
sc_ItemService1.MSSoapInit2 c_WSDL_URL, str_WSML, c_SERVICE, c_PORT, c_SERVICE_NAMESPACE
'Use the proxy server defined in Internet Explorer's LAN settings by
'setting ProxyServer to <CURRENT_USER>
sc_ItemService1.ConnectorProperty("ProxyServer") = "<CURRENT_USER>"
'Autodetect proxy settings if Internet Explorer is set to autodetect
'by setting EnableAutoProxy to True
sc_ItemService1.ConnectorProperty("EnableAutoProxy ") = True
Set sc_ItemService1.ClientProperty("GCTMObjectFactory" ) = New clsof_Factory_ItemService1
Public Function wsm_RetrieveItem_1(ByVal obj_ItemRequest As struct_ItemRequest) As struct_ItemResponse
'************************************************* ****************
'Proxy function created from http://192.168.77.109/sds-ws/ItemService?WSDL.
'************************************************* ****************
'Error Trap
On Error GoTo wsm_RetrieveItem_1Trap
Set wsm_RetrieveItem_1 = sc_ItemService1.RetrieveItem_1(obj_ItemRequest)
Exit Function
wsm_RetrieveItem_1Trap:
ItemService1ErrorHandler "wsm_RetrieveItem_1"
End Function