意外的标识符:'ÿþ'

发布于 2024-10-17 19:58:24 字数 433 浏览 9 评论 0原文

我有一个 BizTalk 解决方案,它分为三个项目:编排、地图和模式。我必须在 Orchestrations 项目中构建一些地图,因为它们需要多个输入模式,而且我发现没有简单的方法可以仅使用 BizTalk Mapper 来做到这一点。一旦我让它们工作,我就把它们转移到我的地图项目中。但是,当我尝试构建该项目时,每个移动的地图(所有地图上的同一点)都会出现以下错误:

意外标识符错误:'ÿþ'(第 2 行,第 2 列)

意外标记错误:'<; ' (第 2 行,第 4 列)

我无法在地图中的任何位置或不应该在的位置找到这些值。我尝试过以不同的格式保存地图,复制并粘贴到新文档,消除第 2 行(这只是创建文档时自动生成的注释),将地图移回 Orchestration 项目,一切都缺少从头开始完全重新创建地图。

有没有人见过这个并知道出了什么问题?

谢谢! 斯蒂芬妮

I have a BizTalk solution which is broken down into three projects: Orchestrations, Maps and Schemas. A few of my maps, I had to build in the Orchestrations project because they needed multiple input schemas and there is no easy way that I've found to do that with just the BizTalk Mapper. Once I got them working, I moved them to my Maps project. But when I try to build that project, I get the following errors for each of the moved maps (same spot on all the maps):

Error unexpected identifier: 'ÿþ' (Line 2, Column 2)

Error unexpected token: '<' (Line 2, Column 4)

I can't find those values anywhere in the map or anywhere they're not supposed to be. I've tried saving the map in different formats, copying and pasting to a fresh document, eliminating Line 2 (which is just an automatically generated comment of when the document was created), moving the maps back to the Orchestration project, everything short of completely recreating the maps from scratch.

Has anyone seen this before and know what is going wrong?

Thanks!
Stephanie

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

又爬满兰若 2024-10-24 19:58:24

正如您所发现的,没有简单的方法可以直接从 BizTalk Mapper 创建具有多个输入或多个输出的映射。正确的方法确实是从 BizTalk 编排中执行此操作。

执行此操作后不需要移动生成的地图的一种方法是在地图项目中创建一个空的编排。当不再需要时可以丢弃该编排。

但是,如果您必须将地图从一个项目移动到另一个项目,请注意以下几点:

  • 导入的架构位置
  • .Net 命名空间

导入的架构位置

创建地图时,输入的位置和输出模式记录在生成的 .btm 文件中。然而,该位置有两种形式,具体取决于地图相对于导入模式位置的位置。

如果映射使用在引用的程序集中声明的架构,则该位置看起来像生成的 .net 类型的完全限定名称。如果您从 Orchestrations 项目生成了地图,但它引用了 Schemas 和 Maps 项目中的架构,则肯定会出现这种情况。

如果映射使用在同一项目/程序集中声明的架构,则该位置将记录为相对路径名。

当您将映射从一个 BizTalk 项目移动到另一项目时,必须恢复声明架构位置的正确方法。在文本编辑器中打开 .btm 文件,并将完全限定名称更改为相对路径,如下所示:

".\imported_schema.xsd"

.Net 命名空间

此外,如果您已将地图从一个项目移动到另一个项目,您可能需要更新他们的 .Net 命名空间。创建时,.net 命名空间与您的地图相关联,并与生成地图的项目中的命名空间相对应。

您可以从 Visual Studio 解决方案资源管理器中的 .btmp 文件属性更改此命名空间。这样,同一项目中的所有工件将始终具有一致的命名。

As you've found out, there are no easy ways to create a map with multiple inputs or multiple outputs directly from the BizTalk Mapper. The correct way is indeed to do this from a BizTalk orchestration.

One way to do this that do not require to move the generated maps afterwards is to create an empty orchestration in your Maps project. This orchestration can be discarded when no longer needed.

If you must move maps from one project to another, however, please, pay attention to the following points :

  • Imported Schema Location
  • .Net Namespaces

Imported Schema Location

When you create a map, the location of the input and output schemas is recorded in the generated .btm file. This location, however, takes two forms, depending upon the location of the map relative to the location of the imported schemas.

If the map uses a schema that is declared in a referenced assembly, the location looks like the fully qualified name of the .net type that is generated. This is certainly the case if you have generated your maps from your Orchestrations project but it references schemas from your Schemas and Maps project.

If the map uses a schema that is declared in the same project/assembly, the location is recorded as a relative path name.

When you move your maps from one BizTalk project to another, you must restore the correct way to declare the schema locations. Open up the .btm file in a text editor and change the fully qualified name to a relative path like this:

".\imported_schema.xsd"

.Net Namespaces

Additionnaly, if you have moved your maps from one project to another, you might want to update their .Net namespace. At the time of creation, a .net namespace is associated with your map and corresponds to the one from the project it has been generated in.

You can change this namespace from from the .btmp file properties in Visual Studio Solution Explorer. This way, you will always have consistent naming across all artifacts from the same project.

虚拟世界 2024-10-24 19:58:24

我对BizTalk一无所知。完全没有。

但从上面的错误我推断有一些文件看起来像这样:

BOM 的目的是成为 UTF-16 编码文件的前两个字节。

因此,该文件看起来像是一个 UTF-16 编码的 XML 文件,但在文件开头添加了一些空格。

我不知道文件格式应该是什么,也不知道在哪里引入了空格,也不知道应该在哪里修复这个问题。但也许这种分析会有所帮助。

I have no knowledge about BizTalk. At all.

But from the above errors I deduce that there is some file which looks like this:

  • It start with an empty line (at most some whitespace).
  • Then it probably has a space as the first character of line 2.
  • Then it has bytes 0xFF and 0xFE, which is the Unicode Byte Order Marker (BOM) used in UTF-16 encoded files.
  • Then it has '<', which suggests the beginning of XML.

The intention of a BOM is to be the first two bytes of an UTF-16-encoded file.

Therefore it looks like the file is an UTF-16-encoded XML file, however with some whitespace prepended at the beginning of the file.

I have no idea about what the file format should be, nor where the whitespace was introduced, nor where this should be fixed. But perhaps this analysis helps.

ζ澈沫 2024-10-24 19:58:24

和 marnix 一样,我对“ÿþ”的第一反应也是 Unicode。
也许您的文件以某种不同的格式保存。

尝试对工作和非工作地图文件执行以下操作:

在 Visual Studio 中

 File > Open > File ... >
 Select your map file > Open With ... (the small dropdown on the Open button) >
 Binary Editor > OK

也许您可以发现文件之间的差异。

另一种尝试是在 Visual Studio 中打开地图文件,

 ...(as above)... > Open With ... >
 XML Editor > OK

然后

 File > Advanced Save Options

查看其中显示的编码。也许您只需在此处更改非工作映射文件的编码(例如,从 UTF-16 更改为 UTF-8)并再次保存它们,以使 BizTalk 的构建引擎满意。

Like marnix, my first response to 'ÿþ' was Unicode, too.
Maybe your files were somehow saved in a different format.

Try to do the following on your working and non-working map files:

In Visual Studio

 File > Open > File ... >
 Select your map file > Open With ... (the small dropdown on the Open button) >
 Binary Editor > OK

Maybe you can spot the difference between your files.

Another try would be to open your map files in Visual Studio with

 ...(as above)... > Open With ... >
 XML Editor > OK

Then

 File > Advanced Save Options

Now see what Encoding is shown there. Maybe you only have to change the Encoding for your non-working map files here (say, from UTF-16 to UTF-8) and save them again to make BizTalk's build engine happy.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文