not getting class definition for exceptions from wsdl

时间:2016-02-12 20:18:32

标签: vb.net web-services soap wsdl

We want to talk to a client's web service. They gave us a function submitButtonClick() { var ss = SpreadsheetApp.getActive(); var sheet = ss.getActiveSheet(); Logger.log('sheet.getName(): ' + sheet.getName()); if (sheet.getName() !== "SubmitReceipt") {return;}; var targetSheet = ss.getSheetByName("ReceiptRecord"); var arrayOfData = []; var week = sheet.getRange(6,9).getValue(); var emplN = sheet.getRange(4,9).getValue(); var purDate = sheet.getRange(9,9).getValue(); var purFrom = sheet.getRange(11,9).getValue(); var custC = sheet.getRange(14,9).getValue(); var deptC = sheet.getRange(16,9).getValue(); var lotC = sheet.getRange(18,9).getValue(); var laborC = sheet.getRange(20,9).getValue(); var itemC = sheet.getRange(22,9).getValue(); var hyperL = sheet.getRange(28,9).getValue(); var notes = sheet.getRange(44,8).getValue(); arrayOfData[0] = week; arrayOfData[1] = emplN; arrayOfData[2] = purDate; arrayOfData[3] = purFrom; arrayOfData[4] = custC; arrayOfData[5] = deptC; arrayOfData[6] = lotC; arrayOfData[7] = laborC; arrayOfData[8] = itemC; arrayOfData[9] = hyperL; arrayOfData[10] = notes; Logger.log('arrayOfData '+ arrayOfData) var lastRow = targetSheet.getLastRow(); Logger.log('lastRow: ' + lastRow); Logger.log('arraylength ' + arrayOfData.length); targetSheet.getRange(lastRow+1, 1, 1, arrayOfData.length).setValues(arrayOfData); sheet.getRange(6,9).clearContent(); sheet.getRange(4,9).clearContent(); sheet.getRange(9,9).clearContent(); sheet.getRange(11,9).clearContent(); sheet.getRange(14,9).clearContent(); sheet.getRange(16,9).clearContent(); sheet.getRange(18,9).clearContent(); sheet.getRange(20,9).clearContent(); sheet.getRange(22,9).clearContent(); sheet.getRange(28,9).clearContent(); sheet.getRange(44,8).clearContent(); } . I could only import it into asp.net using the legacy import -- WSDL Trying to use the regular Add > Service Reference > Advanced > Add Web Reference. gave tons of errors. (I'm guessing that's because this was done with Add > Service Reference and not something newer, but I don't know. I've never done a lot with soap.)

The WSDL includes type definitions for all sorts of soap 1.1 exceptions they might send. They're all in there defined as "SOAP".

But when I import, none of these definitions show up. They don't come as the auto-complete drop down in Visual Studio, and if I type them in I get "no such class" errors. I'm looking in the same namespace where all the classes used in messages appear.

Am I looking in the wrong place? Do these just not show up?

Do I have to re-create these classes manually?

Update

You ask what the error was trying to import as an ordinary service reference. Here it is: (Note: Names changed because the client is very strict about disclosure of their proprietary code.)

Reference.svcmap: Failed to generate code for the service reference 'foo'. Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter Error: There was a problem loading the XSD documents provided: a reference to a schema type with name 'GetFoo' and namespace 'http://example.com/foo/service/v2/' could not be resolved because the type definition could not be found in the schema for targetNamespace 'http://example.com/foo/service/v2/'. Please check the XSD documents provided and try again. XPath to Error Source: //wsdl:definitions[@targetNamespace='http://example.com/foo/ws/v2/']/wsdl:portType[@name='FooPortType_v2'] Cannot import wsdl:binding Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on. XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://example.com/foo/ws/v2/']/wsdl:portType[@name='FooPortType_v2'] XPath to Error Source: //wsdl:definitions[@targetNamespace='http://example.com/foo/ws/v2/']/wsdl:binding[@name='FooBinding_v2'] Cannot import wsdl:port Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on. XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://example.com/foo/ws/v2/']/wsdl:binding[@name='FooBinding_v2'] XPath to Error Source: //wsdl:definitions[@targetNamespace='http://example.com/foo/ws/v2/']/wsdl:service[@name='FooService_v2']/wsdl:port[@name='FooPort_v2'] App_WebReferences/foo/

Note that the very same WSDL works if I import it using the legacy method, so it's not simply an error in the WSDL. The thing is complicated, as the WSDL has multiple levels of includes and imports, complex types composed of other complex types, etc.

Maybe I'm asking the wrong question. Maybe the question should be: Why can I import this WSDL with the legacy import, but not with the current import?

Perhaps I should also note that I was trying to import by copying the WSDL into my app and then doing the Add Service by pointing to this WSDL file. At this time I don't yet have access to the real web site, but they gave me some documentation and the WSDLs.

0 个答案:

没有答案