Profil von Bob NovasBob Novas's WebLogFotosBlogListenMehr ![]() | Hilfe |
|
16 April Debugging Applications that use Groove Web Services by reading the Web Service SOAP conversationWhen you are developing an application that uses Groove Web Services to write records to a Groove Forms Tool (e.g., Forms2Tool), you sometimes run into an exception "The remote server returned an error: (500) Internal Server Error", with a null inner exception. You need more information to debug this problem. The best way I've found is to use a TCP trace utility and look at the SOAP conversation. This blog walks through an example. First of all, the trace utility I often use is tcptrace. This utility is simple to use, but requires a little bit of setup to work with GrooveWebServicesV12Helpers (GWSHelpers), which I use for most of my Groove applications. Tcptrace needs to be put "in-line", between Groove and the application that consumes Groove Web Services (GWS). The way to do that depends on whether you're using a Groove client or a Groove Data Bridge (GDB). It's simple if you're using a GDB. Set the application's Host argument passed to the Context object to a port like 9081, so that the application makes GWS calls to port 9081. Then use tcptrace to map 9081 to 9080 (the port where the GDB listens by default), and you're done. The application makes GWS calls (and receives responses) on 9081 to tcptrace. Tcptrace logs both directions of the SOAP conversation and passes the calls to the GDB on 9080 and the responses to the application listening on 9081. If you're using Groove client, it's a bit trickier. Regardless of the port the caller passes to the Context object, if the RequestKey parameter passed to the Context object is null, GWSHelpers will set the port based on the value of $HKCU\Software\Microsoft\Office\12.0\Groove\GrooveHTTPDesiredPort, which will be 9080 by default. So even if you pass 9081 to the Context object (e.g., by passing http://localhost:9081 as the host parameter), the GWSHelpers will use 9080. The workaround is to change the value of $HKCU\Software\Microsoft\Office\12.0\Groove\GrooveHTTPDesiredPort to 9081 and then run your application – GWSHelpers will then use 9081. If you restart Groove with $HKCU\Software\Microsoft\Office\12.0\Groove\GrooveHTTPDesiredPort set to 9081, Groove will use 9081, and you don't want this – so make sure Groove is running before you change the value. Now make your web service call and watch what tcptrace reports. Now you find that this command (not all of the command is shown): HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.1434) VsDebuggerCausalityData: uIDPozkWzpT+NWpAojz7KKDMYYgAAAAAicJW37gpvEWxefjLoIaUhbSdimHZlKdJvTmKfVC3LmQACQAA Content-Type: text/xml; charset=utf-8 SOAPAction: "http://www.groove.net/Groove/2.0/Forms2#CreateRecords" Host: localhost:9081 Content-Length: 12102 Expect: 100-continue <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><GrooveRequestHeader xmlns="http://webservices.groove.net/Groove/2.0/Core/"><TimeToLive>0</TimeToLive> <GrooveIdentityURL>grooveIdentity://d5whz9tszbqz7pz4rkqiuaeugvw4vyxr@</GrooveIdentityURL> … Yields the response: HTTP/1.1 500 Server error Content-Type: text/xml; charset=utf-8 Connection: close Content-Length: 1063 <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"><soap:Header><GrooveResponseHeader xmlns="http://webservices.groove.net/Groove/2.0/Core/"><GrooveResponseKey>z2f3kgsf7fvn2784zv7tgc9ydxdrxujiqb2wzcs</GrooveResponseKey></GrooveResponseHeader></soap:Header><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Unable to set the 'ShapeTitle' field due to validation constraints.</faultstring><detail><GrooveError><Result>-2147155457</Result><Message>Unable to set the 'ShapeTitle' field due to validation constraints.</Message><ErrorInfo><Description>Unable to set the 'ShapeTitle' field due to validation constraints.</Description><GUID>{1623F60F-8955-44FE-875B-DC5CCF0DDA75}</GUID><Source>GWS</Source><FailureCode>0</FailureCode><Result>-2147155457</Result></ErrorInfo></GrooveError></detail></soap:Fault></soap:Body></soap:Envelope> As you can see above, the message "Unable to set the 'ShapeTitle' field due to validation constraints.", which unfortunately doesn't make it to the exception reported by the application, provides the clue to what's wrong. Further investigation reveals that the ShapeTitle field has a minimum length constraint that the application is violating. It's often helpful to look at the SOAP conversation when debugging a GWS problem – you can often see what's wrong more easily in the messaging than in the code. Kommentare (10)Melden Sie sich zum Hinzufügen eines Kommentars mit Ihrer Windows Live ID an (wenn Sie Hotmail, Messenger oder Xbox LIVE verwenden, besitzen Sie eine Windows Live ID). Anmelden Sie haben noch keine Windows Live ID? Registrieren
TrackbacksDie Trackback-URL für diesen Eintrag ist: http://bobnovas.spaces.live.com/blog/cns!30AB2D2627148CB8!167.trak Weblogs, die sich auf diesen Eintrag beziehen
|
|
|