【发布时间】:2011-09-19 13:09:45
【问题描述】:
我正在尝试让我的 iPhone 应用程序连接到我的 Web 服务。我对这个 Web 服务没有太多经验,所以这就是我在这里寻求信息/帮助的原因。
我第一次尝试来回发送 XML 文件,这需要太多时间。现在我发现有一个应用程序叫:wsdl2objc。它会生成一些目标 C 文件,但我不知道如何使用它。
有人能把我推向正确的方向吗?
下面是我在浏览器中打开的 SVC 文件之一!
Metadata Service
You have created a service.
To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:
svcutil.exe http://server/SB2/services/Metadata.svc?wsdl
This will generate a configuration file and a code file that contains the client class. Add the two files to your client application and use the generated client class to call the Service. For example:
C#
class Test
{
static void Main()
{
entitiesClient client = new entitiesClient();
// Use the 'client' variable to call operations on the service.
// Always close the client.
client.Close();
}
}
Visual Basic
Class Test
Shared Sub Main()
Dim client As entitiesClient = New entitiesClient()
' Use the 'client' variable to call operations on the service.
' Always close the client.
client.Close()
End Sub
End Class
生成de源代码后不想编译:
- (BasicHttpBinding_entitiesBindingResponse *)RetrieveUsing;
- (void)RetrieveAsyncUsing delegate:(id<BasicHttpBinding_entitiesBindingResponseDelegate>)responseDelegate;
- (BasicHttpBinding_entitiesBindingResponse *)DefinedEntitiesUsing;
- (void)DefinedEntitiesAsyncUsing delegate:(id<BasicHttpBinding_entitiesBindingResponseDelegate>)responseDelegate;
错误:
error: expected ';' before 'delegate'
【问题讨论】:
标签: iphone objective-c ios web-services soap